package com.sicaolong.sqlSession;

import java.util.List;

/**
 * @author : sicaolong
 * @description :
 * @date : 2020/10/16  12:33 上午
 */
public class DeafultSqlSession implements SqlSession {

	@Override
	public <E> List<E> selectList(String statementId, Object... params) {
		return null;
	}

	@Override
	public <T> T selectOne(String statementId, Object... params) {
		List<Object> objects = selectList(statementId, params);
		if (objects.size() == 1) {
			return (T) objects.get(0);
		} else {
			throw new RuntimeException("查询结果为空或者是过多了");
		}
	}
}